#include <stdio.h>

int cycle(int r) {
    int result = 0;
    for (int x = -r; x <= r; x++) {
        for (int y = -r; y <= r; y++) {
            if (x * x + y * y == r * r) {
                result++;
            }
        }
    }
    return result;
}

int main(void) {
    int n = 0;
    scanf("%d", &n);
    for(int i = 0; i < n; i++) {
        int r;
        scanf("%d", &r);
        printf("%d\n", cycle(r));
    }
    return 0;
}
